package com.zhc.dejingapi.controller;


import com.zhc.dejingapi.entity.QingProcessplanEntity;
import com.zhc.dejingapi.entity.query.BoilingQuery;
import com.zhc.dejingapi.service.QingProcessplanService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhc
 * @since 2024-10-08
 */
@RestController
@RequestMapping("/qing-processplan-entity")
@CrossOrigin
public class QingProcessplanController {

    @Resource
    private QingProcessplanService qingProcessplanService;

    @PostMapping("/getInjectionList/{eqCode}")
    public List<QingProcessplanEntity> getInjectionList(@PathVariable String eqCode){
        return qingProcessplanService.getInjectionList(eqCode);
    }

    @PostMapping("/addProcessPlan")
    public QingProcessplanEntity addProcessPlan(@RequestBody QingProcessplanEntity qingProcessplanEntity){
        return qingProcessplanService.addProcessPlan(qingProcessplanEntity);
    }

    @PostMapping("/getJobList/{eId}")
    public List<QingProcessplanEntity> getJobList(@PathVariable Long eId){
        return qingProcessplanService.getJobList(eId);
    }

    @PostMapping("/getJob/{mainId}")
    public QingProcessplanEntity getJob(@PathVariable Long mainId){
        return qingProcessplanService.getInfoById(mainId);
    }

    @PostMapping("/selectBoilingProcessPlan")
    public QingProcessplanEntity selectBoilingProcessPlan(@RequestBody BoilingQuery boilingQuery){
        return qingProcessplanService.selectBoilingProcessPlan(boilingQuery.getBoilingBoxCode());
    }

    @PostMapping("/getWithdrawalOfPipeList")
    public List<QingProcessplanEntity> getWithdrawalOfPipeList(){
        return qingProcessplanService.getWithdrawalOfPipeList();
    }
}
